import { ApiPageParams, ApiViewItem, ApiViewParams, CreateApiItem, SaaSApiListItem } from './model/apiModel';
import { maintenanceHttp } from '/@/utils/http/axios';

enum Api {
  SAASApiList = '/api/getList',
  SAAS_CREATE_API_GET = '/api/creategetapi',
  SAAS_VIEW_API = '/api/detail',
}
export const getSaaSApiList = (params: ApiPageParams) => {
  return maintenanceHttp.get<SaaSApiListItem>({
    url: Api.SAASApiList,
    params,
  });
};

export const createApi = (params: CreateApiItem) => {
  return maintenanceHttp.post<string>({ url: Api.SAAS_CREATE_API_GET, params });
};
export const viewSaaSApi = (params: ApiViewParams) => {
  return maintenanceHttp.get<ApiViewItem>({
    url: Api.SAAS_VIEW_API,
    params,
  });
};
